import request from "@/utils/request.js";

// 租赁订单列表
export function getLeaseOrderList(params) {
	return request.get("order/lease_list", params);
}

// 账单列表
export function getInstallmentList(id) {
	return request.get(`order/get_installment_list/${id}`);
}

/**
 * 计算买断金额
 */
export function buyoutMoney(uni, data) {
	return request.post("order/buyout_money/" + uni, data);
}

// 查询租赁宝签约状态
export function getSignContract(id) {
	return request.get(`ato/get_sign_contract/${id}`);
}

// 代扣签约
export function createWithholdSign(id) {
	return request.get(`ato/create_withhold_sign/${id}`);
}
// 代扣签约查询
export function getWithholdSign(id) {
	return request.get(`ato/get_withhold_sign/${id}`);
}
// 代扣主动支付
export function createWithholdActivepay(id, data) {
	return request.post(`ato/create_withhold_activepay/${id}`, data);
}

// 查询代扣主动支付
export function queryWithholdActivepay(id, data) {
	return request.post(`ato/query_withhold_activepay/${id}`, data);
}
// 租完归还
export function returnGoods(id, data) {
	return request.post(`order/return_goods/${id}`, data);
}
// 续租
export function reletLease(id, data) {
	return request.post(`order/relet_lease/${id}`, data);
}
// 支付宝支付
export function leasePay(id, data) {
	return request.post(`order/lease_pay/${id}`, data);
}

// 快捷下单：创建订单
// export function createQuickOrder(data) {
// 	return request.post(`order/create_quick_order`,data)
// }
// 快捷下单：创建订单  （公域）
// export function createPublicQuickOrder(data) {
// 	return request.post(`create_public_order`,data,{
// 		noAuth: true
// 	})
// }
export function createPublicQuickOrder(data) {
	return request.post(`create_rent_order`,data,{
		noAuth: true
	})
}
// 快捷下单：订单数据
// export function cartPublicData(data) {
// 	return request.post(`cart/get_public_data`,data)
// }
// 快捷下单：订单数据（公域）
export function getPublicData(data) {
	return request.post(`get_public_data`,data,{
		noAuth: true
	})
}
// 获取运费
export function getSfFee(data) {
	return request.post(`order/shipping_fee`,data,{
		noAuth: true
	})
}

export function getProductDetail(data) {
	return request.post(`get_product_detail`,data,{
		noAuth: true
	})
}
export function createSaleOrder(data) {
	return request.post(`order/create_sale_order`,data,{
		noAuth: true
	})
}
export function createzfbSaleOrder(data) {
	return request.post(`order/create_vend_order`,data,{
		noAuth: true
	})
}
export function getLeaseDesc(id) {
	return request.get(`product/get_lease_description/`+id,{},{
		noAuth: true
	})
}
// 买断
export function buyoutPay(id,data) {
	return request.post(`order/buyout_pay/`+id,data,{
		noAuth: true
	})
}

// 买断
export function storeProductSku(params) {
	return request.get(`product/store_product_sku`,params,{
		noAuth: true
	})
}

// 灯火
export function lightData(data) {
	return request.post(`product/post_light_data`,data,{
		noAuth: true
	})
}
// 灯火：绑定biz_no，获取灯火参数
export function getLightData(params) {
	return request.get(`product/get_light_data`,params,{
		noAuth: true
	})
}

// 支付宝会员卡详情
export function getAliVip(data) {
	return request.post(`user/level/ali_card_detail`,data,{
		noAuth: true
	})
}

// 卡项权益列表
export function getUserCardList(data) {
	return request.get(`product/get_card_product_list`,data)
}

// 代客绑定订单
export function daikeBind(data) {
	return request.post(`order/bind_order`,data)
}

// 平台地址
export function getPlatformAddress(data) {
	return request.get(`order/get_platform_address`,data)
}
// 快递预估时间
export function getSfPrice(data) {
	return request.post(`order/get_sfexpress_time_price`,data)
}

// 创建顺丰订单
export function createSf(data) {
	return request.post(`order/create_sf_order`,data)
}
// 取消顺丰订单
export function cancelSf(params) {
	return request.get(`order/cancel_back_order`,params)
}


// 支付运费
export function paySf(id,data) {
	return request.post(`order/delivery_pay/${id}`,data)
}

// 获取归还记录
export function getBackDetail(params) {
	return request.get(`order/get_back_detail`,params)
}

// 0元会员列表
export function getZeroVipList(params) {
	return request.get(`user/member/super/index`,params,{
		noAuth: true
	})
}

// 0元会员购买
export function buyZeroVip(data) {
	return request.post(`user/member/super/create`,data)
}


// 0元会员详情
export function zeroVipDetail(params) {
	return request.get(`user/member/super/detail`,params)
}

// 0元会员商品
export function zeroVipGoods(params) {
	return request.get(`user/member/super/product`,params)
}

// 首页商品广告
export function getIndexGoodsAd(params) {
	return request.get("get_home_adv",params,{
		noAuth: true
	});
}
// 首页弹窗广告
export function getIndexPopAd(params) {
	return request.get("get_pop_adv",params,{
		noAuth: true
	});
}

// 0元租包开启状态
export function getZeroVipStatusApi(params) {
	return request.get("user/member/super/status",params,{
		noAuth: true
	});
}